<%@ page language="java" pageEncoding="UTF-8"
	contentType="text/html;charset=UTF-8"%>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    request.setAttribute("basePath",basePath);
%>
<%@ include file="/resources/js/easyui/taglibs.jsp"%>
<%@ include file="/resources/js/easyui/_easyui.jsp"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="format-detection" content="telephone=no" />
<title>用户支付</title>
<link type="text/css" rel="stylesheet" href="../../css/pay.css">
</head>
<body>
	<header class="header">
		<div class="pay_toudaohang">
			<span><img src="../../images/shiliangtu/33.png">
			</span> <span>用户支付</span>
		</div>
	</header>
	<div class="body">
		<div class="pay_bddv1">
			<img src="../../images/images/banner.png" alt="">
			<p>广州力禧捷电子科技有限公司</p>
		</div>
		<div class="pay_bddv2">
			<p>
				<span>设备情况</span> <span id="pay_bdonline">在线</span>
			</p>
			<ul>
				<c:forEach var="entry" items="${discounts}" varStatus="index">
					<li>${entry.money}元${entry.coin}币</li>
					<input type="hidden" value="${entry.discountid }"
						id="discountid${index.index}"   />
				</c:forEach>
			</ul>
		</div>
	</div>

	<form id="form1" >
		<input type="hidden" value="${scanWay}"  id="scanWay" />
		<input type="hidden" value="${deviceid}" name="deviceid" id="deviceid" />
		<input type="hidden" value="" id="discountid" name="discountid"/>
	</form>
	
</body>
</html>
<script type="text/javascript" src="../../js/easyui/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="../../js/fontset.js"></script>
<script type="text/javascript">
	$(function(){
	var scanWay = $("#scanWay").val();
	var deviceid = $("#deviceid").val();
	$(".pay_bdtanchuang, .pay_bdoffline, .pay_bdpaypassword, .pay_bdkeyboard").hide();	  
	var pay_bdonline=$("#pay_bdonline").text();
	$(".pay_bddv2 ul li").each(function(n){
		$(this).click(function(){
	//		var temp = scanWay+"/"+$("#discountid"+n).val();
			
  			var data;
 			if (scanWay == "PAY_SCAN_ALIPAY")
 			{
 				data = "../../alipay";
 			}
 			else if (scanWay == "PAY_SCAN_WEIXIN")
 			{
 				data = "../../weixin";
 			}
 			else
 			{
 				alert("请用支付宝或微信扫一扫");
 				return;
 			}
			$("#form1").attr("action", data);
			$("#discountid").attr("value", $("#discountid"+n).val());
			$("#form1").submit();
			
		});
				
		});
		
	 
});


function send(urlData)
{
	
	
}
	


	
</script>
